package com.wondersgroup.fjzlpt.org.controller.rest.qytj;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.quick.framework.util.QuickPrincipalUtils;
import com.wondersgroup.fjzlpt.org.service.inter.qytj.QytjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 签约统计rest服务
 * <p>
 * <p>
 * Created by sanma on 2017/9/30.
 */
@RestController
@RequestMapping("/qytj")
public class QytjRestController {

    @Autowired
    private QytjService qytjService;
    /**
     * 根据条件分页查询签约统计信息
     * @param request 条件
     * @return 签约统计信息
     */
    @RequestMapping("/queryTjxxPage")
    public JSONObject queryTjxxPage(HttpServletRequest request) {
        Map<String, String> map = RequestUtils.GetParameterMap(request);
		String XZQHDM = QuickPrincipalUtils.getXzqhdm(request);
		map.put("XZQHDM", XZQHDM);
        return qytjService.queryTjxxPage(map);
    }

    /**
     * 根据条件查询签约事件信息
     * @param request 条件
     * @return 签约统计信息
     */
    @RequestMapping("/queryQysjxx")
    public JSONArray queryQysjxx(HttpServletRequest request){
        Map<String, String> map = RequestUtils.GetParameterMap(request);
        return qytjService.queryQysjxx(map);
    }

}
